function updatePosInfo(listPositionsInfo , index ,dValue) {
    for (var i = index + 1; i < listPositionsInfo.length; i++) {
        listPositionsInfo[i].top =
            listPositionsInfo[i - 1].bottom;
        listPositionsInfo[i].bottom =
            listPositionsInfo[i].bottom - dValue;
    }
    return listPositionsInfo;
}

self.addEventListener('message',function(e){
    const { data } = e;
    const list = updatePosInfo(data.list,data.index,data.dValue);
    self.postMessage(list);
})